<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="_freg :: head(~{::title})">
    <meta charset="UTF-8">
    <!--移动端更好的适应-->
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>分类管理</title>
    <link rel="stylesheet" href="../../static/dist/semantic/semantic.min.css"
          th:href="@{/dist/semantic/semantic.min.css}">
    <link rel="stylesheet" href="../../static/css/my.css" th:href="@{/css/my.css}">
</head>

<body>
<!--    导航-->
<nav th:replace="_freg :: menu(3)" class="ui segment inverted attached m-padded-mini m-shadow-small">
    <div class="ui container">
        <div class="ui inverted secondary stackable menu">
            <h2 class="ui teal header item">后台管理</h2>
            <a href="#" class="m-item item m-mobile-hide active"><i class="home icon"></i>博客</a>
            <a href="#" class="m-item item m-mobile-hide"><i class="idea icon"></i>分类</a>
            <a href="#" class="m-item item m-mobile-hide"><i class="tags icon"></i>标签</a>
            <div class="right menu m-item m-mobile-hide">
                <div class="ui dropdown item">
                    <div class="text">
                        <img class="ui avatar image" alt="me.jpg" src="../../static/images/me.jpg"
                             th:src="@{/images/me.jpg}">
                        Dylan
                    </div>
                    <i class="dropdown icon"></i>
                    <div class="menu">
                        <a href="#" class="item">修改密码</a>
                        <a href="#" class="item">个人信息</a>
                        <a href="#" class="item">注销</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <a href="#" class="ui m-menu m-toggle black icon button m-right-top m-mobile-show">
        <i class="sidebar icon"></i>
    </a>
</nav>
<!--    二级导航-->
<div class="ui attached pointing menu">
    <div class="ui container">
        <div class="right menu">
            <a href="#" th:href="@{/admin/tags/toSave.do}" class="item">新增</a>
            <a href="#" th:href="@{/admin/tags}" class="teal item active">列表</a>
        </div>
    </div>
</div>
<!--    中间内容-->
<div>
    <div class="m-container-small m-padded-big">
        <div class="ui container">
            <div class="ui success message" th:unless="${#strings.isEmpty(message)}">
                <i class="close icon"></i>
                <div class="" th:text="|提示: ${message}">提示：操作成功！</div>
            </div>

            <form action="#" method="post" class="ui segment form">
                <div class="inline fields">
                    <div class="field">
                        <input type="text" name="title" placeholder="标签名称">
                    </div>

                    <div class="field">
                        <div class="ui mini teal basic button"><i class="search icon"></i>搜索</div>
                    </div>
                </div>
            </form>

            <table class="ui teal compact table">
                <thead>
                <tr>
                    <th></th>
                    <th>标签名称</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>

                <tr th:each="tag, it : ${page.records}">
                    <td th:text="${it.count}">1</td>
                    <td th:text="${tag.name}">学习笔记</td>
                    <td>
                        <a href="#" th:href="@{/admin/tags/toEdit.do/{id}(id=${tag.id})}"
                           class="ui mini basic teal button">修改</a>
                        <a href="#" th:href="@{/admin/tags/delete/{id}(id=${tag.id})}"
                           class="ui mini basic red button">删除</a>
                    </td>
                </tr>
                </tbody>
                <tfoot>
                <tr>
                    <th colspan="6">
                        <div class="ui pagination menu mini" th:if="${page.getPages} > 1">
                            <a th:href="@{/admin/types(pageNo=${page.hasPrevious}?${page.current - 1}:${page.current})}"
                               class="ui item" th:if="${page.hasPrevious}">上一页</a>
                            <a th:href="@{/admin/types(pageNo=${page.hasNext}?${page.current + 1}:${page.current})}"
                               class="ui item" th:if="${page.hasNext}">下一页</a>
                        </div>
                        <a href="#" th:href="@{/admin/tags/toSave.do}"
                           class="ui teal basic button right floated mini">新增</a>
                    </th>
                </tr>
                </tfoot>
            </table>
        </div>
    </div>
</div>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>

<!--    页脚-->
<footer th:replace="_freg :: footer" class="ui inverted segment  vertical m-padded-large">
    <div class="ui container center aligned">
        <div class="ui inverted stackable grid divided">
            <div class="three wide column">
                <div class="ui inverted link list">
                    <div class="item">
                        <img src="../../static/images/wechat.jpg" class="ui rounded image" alt="亚里士多得"
                             style="width: 100px">
                    </div>
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted">最新博客</h4>
                <div class="ui inverted link list">
                    <a href="#" class="item">博客1</a>
                    <a href="#" class="item">博客1</a>
                    <a href="#" class="item">博客1</a>
                    <a href="#" class="item">博客1</a>
                </div>
            </div>
            <div class="three wide column">
                <h4 class="ui inverted">联系我</h4>
                <div class="ui inverted link list">
                    <a href="#" class="item">QQ:3402747477</a>
                    <a href="#" class="item">邮箱:3402747477@qq.com</a>
                </div>
            </div>
            <div class="seven wide column">
                <h4 class="ui inverted">介绍</h4>
                <div class="ui inverted link list">
                    <p class="m-opacity-mini">
                        这是我的个人博客、会分享关于编程、写作、思考相关的任何内容，希望可以给来到这儿的人有所帮助
                    </p>
                </div>
            </div>
        </div>
        <!--    分隔符-->
        <div class="ui inverted section divider"></div>
        <div class="m-text-thin m-text-spaced m-opacity-mini">
            Copyright 2023-now ZBlog Designed by dylan
        </div>
    </div>

</footer>

<!-- /*/<th:block th:replace="_freg :: script">/*/-->
<script type="text/javascript" src="../../static/dist/jquery/jquery-3.4.1.min.js"
        th:src="@{/dist/jquery/jquery-3.4.1.min.js}"></script>
<script rel="script" src="../../static/dist/semantic/semantic.js" th:src="@{/dist/semantic/semantic.js}"></script>
<!--/*/</th:block>/*/-->
<script type="text/javascript" rel="script">
    $(function () {
        $('.m-menu.m-toggle').click(function () {
            $('.m-item').toggleClass('m-mobile-hide');
        });
        $(".dropdown").dropdown({
            on: "hover"
        });

        //消息提示关闭初始化
        $('.message .close')
            .on('click', function () {
                $(this)
                    .closest('.message')
                    .transition('fade');
        });
    });
</script>
</body>
</html>